<!--
 * @Author: 闫聪敏
 * @Email: 
 * @Date: 2020-02-24 08:33:59
 * @Descripttion: 
 -->
<div class="work-manage-component">
    <div nz-row nzGutter="10" class="row_1">
        <div nz-col class="operate_btn" nzSpan="6">
            <button nz-button nzType="primary"  (click)="handleShowErpModal()" [nzLoading]="isLoading">获取ERP数据</button>
            <button nz-button nzType="" class="ant-btn ant-btn-primary" (click)="save()" *ngIf="bornRoles.save">
                <i nz-icon nzType="save"></i>保存
            </button>
        </div>
        <div nz-col nzSpan="14"></div>
        <div nz-col nzSpan="3">
            <input nz-input placeholder="输入项目工作令" appHotSearch (hotSearchEmit)="getSearchList()" [(ngModel)]="searchKey" />
        </div>
        <!-- <div nz-col nzSpan="4" class="operate_btn">
            <button nz-button nzType="" (click)="submitSearch()">
                <i nz-icon nzType="search"></i>搜索
            </button>
        </div> -->
    </div>

    <div nz-row class="row_3">
        <nz-table #expandTable [nzData]="listData" nzSize="small" [nzFrontPagination]="false" [nzBordered]="true" style="margin-top: 5px;">
            <thead>
                <tr>
                    <th nzShowCheckbox [(nzChecked)]="isAllChecked" [nzIndeterminate]="isIndeterminate"
                        (nzCheckedChange)="checkAll($event)"></th>
                    <th>项目工作令</th>
                    <th>时间</th>
                    <th>项目负责人</th>
                    <th>备注</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of expandTable.data">
                    <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="checkSingle()"></td>
                    <td>
                        {{ data.content }}
                        <!-- <input nz-input placeholder="Basic usage" [(ngModel)]="data.content" /> -->
                    </td>
                    <td>{{ data.createDate }}</td>
                    <td>
                        <!-- <input nz-input placeholder="Basic usage" [(ngModel)]="data.manager" /> -->
                        <nz-tree-select
                                [nzAllowClear]="false"
                                [nzDropdownStyle]="{left : '-200px'}"
                                style="width: 100%"
                                [nzNodes]="nodes"
                                [(ngModel)]="data.manager"
                                (ngModelChange)="onChange($event)"
                            >
                        </nz-tree-select>
                    </td>
                    <td>
                        {{ data.remarks }}
                        <!-- <input nz-input placeholder="Basic usage" [(ngModel)]="data.remarks" /> -->
                    </td>
                </tr>
            </tbody>
        </nz-table>
        <div nz-row class="row_4" *ngIf="expandTable.data.length!=0" class="page_box" style="margin-top: 20px;">
            <nz-pagination (nzPageIndexChange)="clickPage($event)" [(nzPageIndex)]="pageIndex" [nzTotal]="totalSize"
                [nzShowTotal]="totalTemplate"></nz-pagination>
            <ng-template #totalTemplate let-total> 总共 {{totalSize}} 条 </ng-template>
        </div>
    </div>
</div>